package com.bridge.bridge_wd.activity;

import android.view.View;

import com.bridge.bridge_wd.R;
import com.bridge.bridge_wd.databinding.ActivityNovoiceBinding;
import com.bridge.common.base.BaseActivity;
import com.bridge.common.utils.CalendarDayUtils;
import com.bridge.common.utils.CalendarTimeUtils;
import com.bridge.common.utils.UltimateBarXUtils;

/**
 * @ClassName NoVoiceActivity
 * @Description TODO消息
 * @Author xushufeng
 * @CreateDate 2021/4/11 0011 15:38
 * @Version 1.0
 * @UpdateDate 2021/4/11 0011 15:38
 * @UpdateRemark 更新说明
 */
public class NoVoiceActivity extends BaseActivity {
    ActivityNovoiceBinding binding;
    boolean falg = true;

    @Override
    protected int layoutId() {
        return R.layout.activity_novoice;
    }

    @Override
    protected void initView() {
        binding = getBind();
        binding.linearTimeStart.setOnClickListener(this);
        binding.linearTimeEnd.setOnClickListener(this);
        binding.imageKaiguan.setOnClickListener(this);
        UltimateBarXUtils.setAppBar(this, true, true, R.color.color_f5f5f5);
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);

        if (view.getId() == R.id.image_kaiguan) {
            if (falg) {
                falg=false;
                binding.linearTimeStart.setVisibility(View.VISIBLE);
                binding.linearTimeEnd.setVisibility(View.VISIBLE);
                binding.imageKaiguan.setImageDrawable(getResources().getDrawable(R.mipmap.kai));
            }else{
                falg=true;
                binding.linearTimeStart.setVisibility(View.GONE);
                binding.linearTimeEnd.setVisibility(View.GONE);
                binding.imageKaiguan.setImageDrawable(getResources().getDrawable(R.mipmap.guan));
            }

        }
        if (view.getId() == R.id.linear_time_start) {

            CalendarTimeUtils.getInstance(NoVoiceActivity.this).setDateTime().show(binding.tvStartTime);
        }
        if (view.getId() == R.id.linear_time_end) {
            CalendarTimeUtils.getInstance(NoVoiceActivity.this).setDateTime().show(binding.tvEndTime);
        }
    }

    @Override
    protected void setListenner() {

    }
}
